﻿$(document).ready(function () {

    var name = $("#name").val();
    layui.use('table', function () {
        var table = layui.table,
            form = layui.form;
        table.render({
            elem: '#test'
            , url: '/Myrecode/Display'
            , cellMinWidth: 80
            , cols: [[
                { field: 'TaskTiltle', width: 125, title: '任务标题' }
                , { field: 'Publisher', width: 80, title: '发布人' }
                , { field: 'oneer', width: 80, title: '执行人' }
                , { field: 'CompletionTime', width: 175, title: '发布时间', sort: true, templet: "<div>{{Format(d.CompletionTime,'yyyy-MM-dd hh:mm:ss')}}</div>" }
                , { field: 'ReleaseTime', title: '执行时间', width: 175, sort: true, templet: "<div>{{Format(d.ReleaseTime,'yyyy-MM-dd hh:mm:ss')}}</div>" }
                , { field: 'TaskContent', title: '任务内容', width: 430 }
                , { field: 'Status', title: '是否完成', width: 90, templet: '#switchTpl', unresize: true }
            ]]
            , page: true
            , id: 'testReload'
        });
    });

    $("#sele").click(function () {
        TableReload();
    });


    function TableReload() {
        var table = layui.table;
        //获取页面管理员名称和时间
        var Publisher = $("#Publisher").val();
        var TaskTiltle = $("#TaskTiltle").val();
        var CompletionTime = $("#demo").val();
        //上述方法等价于
        table.reload('testReload', {
            where: { //设定异步数据接口的额外参数，任意设
                Publisher: Publisher,
                TaskTiltle: TaskTiltle,
                CompletionTime: CompletionTime
                //…
            }
        });
    };

});